﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Coater.Helper
{
    public class ComFunc
    {
        /// <summary>
        /// 获取指定控件下的所有某类型控件
        /// </summary>
        public static void GetControl<T>(Control container, ref List<T> li) where T : class
        {
            if (container is T con)
            {
                li.Add(con);
            }
            if (container.Controls.Count > 0)
            {
                foreach (Control c in container.Controls)
                {
                    GetControl(c, ref li);
                }
            }
        }


    }
}
